/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controladores;

import Entidades.Recepcion;
import Entidades.Remito;
import java.util.List;
import logica.jpaControllers.RecepcionJpaController;
import logica.jpaControllers.RemitoJpaController;
import logica.jpaControllers.exceptions.IllegalOrphanException;

/**
 *
 * @author USER
 */
public class CtrlRecepcion {

    /** Creates a new instance of CtrlABMArticulos */
    public CtrlRecepcion() {
    }
    //guarda articulo

    public void guardarRecepcion(Recepcion re) throws IllegalOrphanException {
        RecepcionJpaController ga = new RecepcionJpaController();
        ga.create(re);
    }

    public void eliminarRecepcion(Recepcion re) throws Exception {
        RecepcionJpaController ga = new RecepcionJpaController();
        ga.destroy(re.getNumeroRecepcion());
    }

    public void modificarRecepcion(Recepcion re) throws Exception {
        RecepcionJpaController ga = new RecepcionJpaController();
        ga.edit(re);
    }

    public Recepcion buscarRecepcion_X_idRecepcion(int idremito) {
        RecepcionJpaController ga = new RecepcionJpaController();
        return ga.findRecepcion(idremito);

    }



    public List buscarTodosRemito() throws Exception {
        RemitoJpaController ga = new RemitoJpaController();
        return ga.findRemitoEntities();
    }

}
